package com.wfm.increment;

import java.util.Date;
import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.JobParametersBuilder;
import org.springframework.batch.core.JobParametersIncrementer;

public class DailyTimestampParamIncrementer implements JobParametersIncrementer {

    @Override
    public JobParameters getNext(JobParameters parameters) {
        JobParametersBuilder jobParametersBuilder = new JobParametersBuilder(parameters);
        jobParametersBuilder.addLong("daily", new Date().getTime());
        return jobParametersBuilder.toJobParameters();
    }
}
